package com.slz3.business.module.configManagement.conCircle.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.configManagement.conCircle.domain.ConCircle;
import com.slz3.business.module.configManagement.conCircle.domain.ConCircleCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class ConCircleResAtomic {

    static Mono<ServerResponse> add_$ConCircleUpdateLock(ServerRequest req, ConCircle conCircle) {
        return ConCircleResSafeValid.add(req, conCircle) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConCircleResExecutor.add(req, conCircle);
    }

    public static Mono<ServerResponse> delete_$ConCircleUpdateLock(ServerRequest req, ConCircleCondition conCircleCondition) {
        return ConCircleResSafeValid.delete(req, conCircleCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConCircleResExecutor.delete(req);
    }

    static Mono<ServerResponse> modify_$ConCircleUpdateLock(ServerRequest req, ConCircle conCircle) {
        return ConCircleResSafeValid.modify(req, conCircle) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConCircleResExecutor.modify(req, conCircle);
    }

    static Mono<ServerResponse> info_$ConCircleUpdateLock(ServerRequest req) {
        return ConCircleResSafeValid.info(req) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConCircleResExecutor.info(req);
    }

    public static Mono<ServerResponse> auditSubmit_$ConCircleUpdateLock(ServerRequest req, ConCircleCondition conCircleCondition) {
        return ConCircleResSafeValid.auditSubmit(req, conCircleCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConCircleResExecutor.auditSubmit(req);
    }

    public static Mono<ServerResponse> audit_$ConCircleUpdateLock(ServerRequest req, ConCircleCondition conCircleCondition) {
        return ConCircleResSafeValid.audit(req, conCircleCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConCircleResExecutor.audit(req);
    }

    public static Mono<ServerResponse> auditReject_$ConCircleUpdateLock(ServerRequest req, ConCircleCondition conCircleCondition) {
        return ConCircleResSafeValid.auditReject(req, conCircleCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConCircleResExecutor.auditReject(req);
    }


    public static Mono<ServerResponse> usingEnable_$ConCircleUpdateLock(ServerRequest req, ConCircleCondition conCircleCondition) {
        return ConCircleResSafeValid.usingEnable(req, conCircleCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConCircleResExecutor.usingEnable(req);
    }

    public static Mono<ServerResponse> usingDisable_$ConCircleUpdateLock(ServerRequest req, ConCircleCondition conCircleCondition) {
        return ConCircleResSafeValid.usingDisable(req, conCircleCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConCircleResExecutor.usingDisable(req);
    }
}
